#ifndef CMENUBUTTON_H
#define CMENUBUTTON_H

#include <QWidget>
#include <QLabel>
#include <QVBoxLayout>
#include <QMouseEvent>
#include <QPainter>

namespace Ui {
class Cmenubutton;
}

class Cmenubutton : public QWidget
{
    Q_OBJECT

public:
    explicit Cmenubutton(QWidget *parent = nullptr);
    ~Cmenubutton();

    void setNormalImg(QString s);
    void sethoverImg(QString s);
    void setPressImg(QString s);
    void setButtonTxt(QString s);
    void setButtonNolmalStatus();
    void setButtonSelectStatus();

    bool needSelect = false;

protected:
    void enterEvent(QEvent *);
    void leaveEvent(QEvent *);
    void mousePressEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);

signals:
    void btnClicked();

private:
    Ui::Cmenubutton *ui;
    enum ButtonStatus{NORMAL, HOVER, PRESS};
    ButtonStatus status;
    bool mouse_press;
    QString normalImg;
    QString hoverImg;
    QString pressImg;
};

#endif // CMENUBUTTON_H
